﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UCTienIch.ascx.cs" Inherits="UControls_UCTienIch" %>
  <%--<script type="text/javascript" src="../Scripts/jquery-1.7.1.min.js"></script>--%>
  <style type="text/css">
    .dangnhap
    {
        font-style:italic;color: #999999; 
    }
    #btnTimKiem {
    background: url("../Images/qSearch.png") no-repeat scroll center center; 
    background-size:20px 16px;
    cursor: pointer;
    height: 18px;
    margin-left: -1px;
    padding: 0;
    position: absolute;
    right: 78px;
    top: 9px;
    width: 30px;
	border-left-style: none;
	border-left-color: inherit;
	border-left-width: 0;
	border-right-style: solid;
	border-right-width: 0px;
	border-top-style: solid;
	border-top-width: 0px;
	border-bottom-style: solid;
	border-bottom-width: 0px;
	left: 813px;
    }
 </style>   
 <table cellpadding="0", cellspacing="0" style="width:100%">
            <tr style="height:30px">
            <td>
        <asp:Label ID="lblKhacHang" runat="server" Text="Kính chào quý khách!" 
            Font-Bold="False" Font-Italic="True" ForeColor="White" ></asp:Label>
        <asp:LinkButton ID="LnkThoat" runat="server" ForeColor="#990000" 
                    onclick="LnkThoat_Click" Visible="False">[Thoát]</asp:LinkButton>
        <input  class="dangnhap" id="txtTenDangNhap" type="text" runat="server" style="width:120px; " 
            value="Tên đăng nhập" onfocus="if(value=='Tên đăng nhập'){value=''}" 
                onblur="if(value=='') {value='Tên đăng nhập'}" causesvalidation="False" />
        <input class="dangnhap" id="txtMatkhau" type="text" runat="server" style="width:70px; " 
            value="Mật khẩu" onfocus="this.type='password'; if(value=='Mật khẩu'){value=''}" 
                onblur="if(value=='') {value='Mật khẩu'; this.type='text'}" causesvalidation="False" />
                
  </td><td style="width:160px">
        <asp:ImageButton ID="btnDangNhap" runat="server" 
            ImageUrl="~/Images/DangNhap.jpg" CausesValidation="False" 
                        onclick="btnDangNhap_Click" />
        <asp:ImageButton ID="btnDangKy" runat="server" onclick="btnDangKy_Click" 
            ImageUrl="~/Images/DangKy.jpg" CausesValidation="False" />
         </td><td style="width:210px">
	            <input class="dangnhap" type="text" value="Tên sản phẩm" title="Nhập sản phẩm cần tìm" 
                maxlength="100" style="width:200px" id="txtSearch" runat="server" 
                onfocus="if(value=='Tên sản phẩm'){value=''}" 
                onblur="if(value=='') {value='Tên sản phẩm'}" causesvalidation="False" 
                        clientidmode="Static" />
	            <input type="button" title="Tên sản phẩm" id="btnTimKiem" />
                    <%-- Xử lý nút tìm--%>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $('#btnTimKiem').click(function () {

                $.post('../Handler/ChuoiTim_Handler.ashx', { Chuoitim: $('#txtSearch').val() },
                    function (response) {
                        gtriTim = response;
                        window.location.href = "../Pages/TimKiem.aspx?TenSanPham=" + gtriTim;
                    }
                );
            });

            $('#txtSearch').keypress(function (e) {
                code = e.keyCode ? e.keyCode : e.which;
                if (code.toString() == 13) {

                    $.post('../Handler/ChuoiTim_Handler.ashx', { Chuoitim: $('#txtSearch').val() },
                    function (response) {
                        gtriTim = response;
                        window.location.href = "../Pages/TimKiem.aspx?TenSanPham=" + gtriTim;
                    }
                );
                }
            });
        });
  
    </script>
            </td><td style="width:75px">
        <asp:ImageButton ID="btnTroGiup" runat="server" 
            ImageUrl="~/Images/TroGiup.jpg" CausesValidation="False" onclick="btnTroGiup_Click" />
            </td>
            </tr>
 </table>
